package com.epfly.api.promo.activity;


import com.epfly.iface.promo.activity.ActivityService;
import com.epfly.iface.promo.activity.ActivityURL;
import com.epfly.iface.promo.activity.vo.GetDiscountAmountRequest;
import com.epfly.iface.promo.activity.vo.GetDiscountAmountResp;
import com.epfly.iface.promo.activity.vo.GetDiscountAmountWithBoundRequest;
import com.epfly.iface.promo.activity.vo.GetDiscountAmountWithBoundResp;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class ActivityClientController {

    @Resource
    private ActivityService activityService;

    @GetMapping(value = ActivityURL.ACTIVITY_GET_DISCOUNT_AMOUNT)
    public ResponseEntity<GetDiscountAmountResp> getDiscountAmount(@Validated GetDiscountAmountRequest request) {
        GetDiscountAmountResp resp = activityService.getDiscountAmount(request);
        return ResponseEntity.ok(resp);
    }

    @GetMapping(value = ActivityURL.ACTIVITY_GET_DISCOUNT_AMOUNT_WITH_BOUND)
    public ResponseEntity<GetDiscountAmountWithBoundResp> getDiscountAmountWithBound(@Validated GetDiscountAmountWithBoundRequest request) {
        GetDiscountAmountWithBoundResp resp = activityService.getDiscountAmountWithBound(request);
        return ResponseEntity.ok(resp);
    }




}
